<template>
  <el-tree-select
    :data="items"
    :props="props"
    :node-key="nodeKey"
    :placeholder="$t(placeholder)"
    class="z-tree-select"
  ></el-tree-select>
</template>

<script lang="ts" setup>
import { useI18n } from 'vue-i18n'

const PROPS = defineProps<{
  items?: AnyObject[]
  props?: AnyObject
  nodeKey?: string
  i18n?: boolean
  i18nPrefix?: string
  placeholder?: string
}>()

const { t } = useI18n()
const $t = (text?: string) => {
  return PROPS.i18n && text ? t((PROPS.i18nPrefix ? PROPS.i18nPrefix + '.' : '') + text) : text
}
</script>

<style lang="scss">
.z-tree-select {
  min-width: var(--z-input-min-width);
}
</style>
